
#VPATH = 

# ........ makefile

Target = BankNote_Receiver.hex 
SourceList = main.c my_macros.c Inputs.c SysTime.c Receiver.c #UART.c
MicroType = 16F628A

def f = pipe

#ObjectList = $(patsubst %.c, %.obj, $(wildcard *.c )))
ObjectList = $(patsubst %.c, %.obj, $(SourceList)) 

ifneq ($(f), p)
$(Target) : $(ObjectList)
	PICC.EXE -E $^ -O$@ -Q -$(MicroType)
	CLEAN.BAT
else
$(Target) : $(ObjectList)
	PICC.EXE -E $^ -O$@ -Q -$(MicroType)
	CLEAN.BAT
	WinPic800.exe -p -s -dPIC$(MicroType) $(Target)
#	D:\PROGRA~1\Soft-Log\IcpWin\ICP_Win.exe $(Target) /p

endif

%.obj : %.c
	PICC.EXE -C -E $< -O$@ -Zg9 -O -Q -$(MicroType)

# c: 
# 	CLEAN.BAT
# 	del $(Target) 

c:
	rm -f *.obj $(Target)

e:
	etags *.c *.h

p:
	C:\WinPic800\WinPic800.exe -p -s -dPIC$(MicroType) $(Target)
#	D:\PROGRA~1\Soft-Log\IcpWin\ICP_Win.exe $(Target) /p

